<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <div v-for="item in this.list" :key={item}>
      {{ item }}
    </div>
  </div>
</template>

<script>
import {login} from "@/api/login";

export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  data() {
    return {
      list: null
    }
  },
  created() {
    login().then(res => {
      // console.log(res)
      console.log('接口返回数据：', {code: res.status, data: res.data, path: res.request.responseURL})
      this.list = [res.status,
        res.data.data,
        res.request.responseURL]
    })
  },
  methods: {}


}
</script>

<style scoped>
h3 {
  margin: 40px 0 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
